<?php
/**
 *
 */
class sqlutil extends CI_Controller {
  public function __construct() {
    parent::__construct();
    $this->load->helper('url');
    $this->load->helper('form');
    $this->load->library('session');
    $this->load->helper('string');
    $this->load->helper('file');
    $this->load->library('DbManage');
    if($this->session->userdata('username')==null){
      redirect('/login');
    }
  }
  public function sqlsave(){
    $db = new DBManage ( 'localhost','root','root', 'crm', 'utf8' );
    $db->backup('','d://fuck/'.date('Y-m-d').'/',2048);
  }
  public function sqlload(){
    $db = new DBManage ( 'localhost','root','root', 'crm', 'utf8' );
    $db->restore ( 'd://fuck/2017-08-11/20170811164039_all_v1.sql');
  }
}
